package pers.whj.rpc.server;

import pers.whj.rpc.protocol.Response;
import pers.whj.rpc.serialize.EncoderImpl;

public class ServerUtils {
    public static byte[] getErrorResponse(String errorMsg) {
        Response res = new Response(Response.UNKNOWN_SOURCE);
        res.setCode(Response.CODE_ERROR);
        res.setErrorMsg(errorMsg);
        return new EncoderImpl().encode(res);
    }
}
